<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8" />
  <meta name="viewport"
        content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  <title>支付成功</title>
  <style type="text/css">
    .btn {
      display: none;
      margin: 20px auto;
      padding: 5px;
      background-color: #007aff;
      border: 0;
      color: #ffffff;
      height: 40px;
      width: 200px;
    }
  </style>
</head>

<body>
<h1>支付成功</h1>
<div class="btn-list">
  <button id="navigateTo" class="btn" type="button" data-action="navigateTo">navigateTo</button>
</div>

<script type="text/javascript" src="https://b.bdstatic.com/searchbox/icms/searchbox/js/swan-2.0.22.js"></script>
<!-- uni 的 SDK -->
<script type="text/javascript" src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js"></script>
<script type="text/javascript">
  /* 页面初始化时就会调用 */
  window.onload = function (){
    document.getElementById("navigateTo").click();
  }

  // 待触发 `UniAppJSBridgeReady` 事件后，即可调用 uni 的 API。
  document.addEventListener('UniAppJSBridgeReady', function () {
    uni.postMessage({
      data: {
        action: 'message'
      }
    });

    uni.redirectTo({
      url: '/pages/tabbar-3-detial/tabbar-3-video/tabbar-3-video?data=ok'
    });

    document.querySelector('.btn-list').addEventListener('click', function (evt) {
      var target = evt.target;
      if (target.tagName === 'BUTTON') {

        uni.redirectTo({
          url: '/pages/tabbar-3-detial/tabbar-3-video/tabbar-3-video?data=ok'
        });
      }
    });
    document.getElementById('postMessage').addEventListener('click', function () {
      console.log('通信消息', uni)
      uni.postMessage({
        data: {
          action: 'back'
        }
      });
    });
  });
</script>
</body>
</html>